/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validMobile(str) {
  return /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/.test(
    str
  ) // 校验手机号
}

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function validPassword(path) {
  return /^[a-z0-9]{6,10}$/i.test(path)
}
